export const childrenRouter = [
    {
        path: '/home',
        name: 'home',
        component:  () => import('@/views/home/index.vue'),
        meta: {
            title: '全部文件',
            icon: 'file'
        }
    },
    {
        path: '/share',
        name: 'share',
        component: () => import('@/views/share/index.vue'),
        meta: {
            title: '我的分享',
            icon: 'share'
        }
    },
    {
        path: '/dustbin',
        name: 'dustbin',
        component: () => import('@/views/dustbin/index.vue'),
        meta: {
            title: '垃圾箱',
            icon: 'dustbin'
        }
    },
    {
        path: '/mine',
        name: 'mine',
        component: () => import('@/views/mine/index.vue'),
        meta: {
            title: '我的',
            icon: 'mine'
        }
    }
]

export const constantRouter = [
    // 路由配置
    {
        path: '/',
        name: 'layout',
        component: () => import('@/layout/index.vue'),
        redirect: '/home',
        children: childrenRouter
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            title: '登录',
            icon: 'login'
        }
    },
    {
        path: '/register',
        name: 'register',
        component: () => import('@/views/register/index.vue'),
        meta: {
            title: '注册',
            icon: 'register'
        }
    },
    {
        path: '/external-sharing',
        name: 'external-sharing',
        component: () => import('@/views/external-sharing/index.vue'),
        redirect: '/verify/:id',
        children: [
            {
                path: '/verify/:id',
                name: 'verify',
                component: () => import('@/views/external-sharing/verify/index.vue'),
                meta: {
                    title: '分享',
                }
            },
            {
                path: '/s/:id',
                name: 'share-list',
                component: () => import('@/views/external-sharing/share-list/index.vue'),
                meta: {
                    title: '分享',
                }
            }
        ]
    },
    {
        path: '/404',
        component: () => import('@/views/404/index.vue'),
        name: '404',
        meta: {
            title: '404',
            hidden: true
        },
    },
    {
        path: '/:pathMatch(.*)*',
        redirect: '/404',
        name: 'any',
        meta: {
            title: '任意路由',
            hidden: true
        },
    }

]